#include<iostream>
#include<algorithm>
using namespace std;
const int N = 20;
int s[N] , c[N];
int cnt;
int ret = N;
int n , w;

bool cmp(int a , int b)
{
    return a > b;
}

void dfs(int pos)
{
    if(cnt >= ret) return;
    if(pos > n)
    {
        ret = cnt;
        return;
    }

    for(int i = 1;i <= cnt;i ++)
    {
        if(s[i] + c[pos] > w) continue;
        s[i] += c[pos];
        dfs(pos + 1);
        s[i] -= c[pos];
    }

    cnt++;
    s[cnt] = c[pos];
    dfs(pos + 1);
    s[cnt] = 0;
    cnt--;
}
int main()
{
    cin >> n >> w;
    for(int i = 1;i <= n;i ++) cin >> c[i];
    sort(c + 1 , c + 1 + n , cmp);
    dfs(1);
    cout << ret << endl;
    return 0;
}